/*
 * @Author: your name
 * @Date: 2021-11-10 13:48:35
 * @LastEditTime: 2023-03-21 14:40:50
 * @LastEditors: tanggx
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \agcim-viewer\src\views\js\store\index.js
 */

import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

import user from './user'
export default new Vuex.Store({
  state: {
    //功能区缩放状态
    mainBoxState: false,
    //选中的模型
    selectedModel: null,
    //加载框状态
    loadingState: false,
    //临时演示图例
    isLegendShow: false,
    //选中的目录菜单
    selectedMenu: null,
    //视点切换，视点关联的图层
    viewSelectedLayer: null,
    //属性弹窗状态，是否显示
    attrRadio: null,
    //场景光效当前选中的下标
    sceneEffectIndex: -1,
    //个人图层实时变化状态
    layerTreeMiniState: false,
    showLayerTreeMini: false,//是否启用个人图层树
    // 专题变化，底图变
    baseLayerSwitchState: null,
    layerTreeResult: null,//图层树数据
    projectName: "", //专题树名称,
    fontStyle:{
       bar:{
          XFont:15,
          yFont:15,
          yName:15,
          legend:15,
          title:15,
          tooltip:10,
          barWidth:15,
          rbarWidth:12,
          rXFont:15,
       },
       pie:{
          XFont:15,
          yFont:15,
          yName:15,
          legend:15,
          title:15,
          tooltip:10,
          labelRich:15
       },
       line:{
          XFont:15,
          yFont:15,
          yName:15,
          legend:15,
          title:15,
          tooltip:10,
          labelRich:15,
          symbolSize:8,
          lineSize:4
       },
       map:{
          legend:15,
          tooltip:12
       }
    },
    fontStyle2:{
      bar:{
        XFont:20,
        yFont:20,
        yName:20,
        legend:15,
        title:20,
        tooltip:15,
        barWidth:30,
        rbarWidth:12,
        rXFont:18,
      },
      pie:{
         XFont:20,
         yFont:20,
         yName:20,
         legend:15,
         title:20,
         tooltip:15,
         labelRich:15
      },
      line:{
         XFont:20,
         yFont:20,
         yName:20,
         legend:20,
         title:20,
         tooltip:20,
         symbolSize:15,
         lineSize:6,
         labelRich:20
      },
      map:{
        legend:20,
        tooltip:20
      }
   }
  },
  mutations: {
    handleSelectedMenu: (state, menuId) => {
      state.selectedMenu = menuId;
    },
    setViewSelectedLayer: (state, layer) => {
      state.viewSelectedLayer = layer;
    },
    changeBaseLayerSwitch: (state, layer) => {
      state.baseLayerSwitchState = layer;
    },
    changeLayerTreeResult: (state, res) => {
      state.layerTreeResult = res;
    },
    changeProjectName: (state, projectName) => {
      state.projectName = projectName;
    },
    //大屏展示的字体统一修改
    handleChangesLargeFont:(state,fontObject)=>{
        //
        state.fontStyle= state.fontStyle2;
    }
  },
  actions: {
  },
  modules: {
    user,
  },
  getters: {
    viewLayerInfo: state => state.viewSelectedLayer,
  }
})